import _ from 'lodash';
import './style.css';
import Icon from './icon.png';

import { cube } from './math.js';

function component() {
  var element = document.createElement('div');

  // Lodash（目前通过一个 script 脚本引入）对于执行这一行是必需的
  element.innerHTML = _.join(['Hello', 'webpack'], ' ');
  element.classList.add('hello');

  var myIcon=new Image();
  myIcon.src=Icon;
  element.appendChild(myIcon);
  
  
  return element;
}
function component2() {
  var element = document.createElement('pre');

  element.innerHTML = [
     'Hello webpack!',
     '5 cubed is equal to ' + cube(5)
   ].join('\n\n');
  
  return element;
}
document.body.appendChild(component());

document.body.appendChild(component2());